Metadata API Documentation
Metadata Creation Endpoint
- Method: POST
- Path:
https://api.kadal.ai/cl/metadata/api/v1/metadata - Summary: Create a new metadata in the repository
Description
This endpoint creates a new metadata entry in the metadata repository. The metadata can be of different types (KVP, TAG, TAXONOMY) with configurable value types (select, text, datetime, number) for KVP type metadata.
Request
-
Content-Type: application/json
-
Authorization: Bearer token required
-
Payload
| Parameter | Description | Data Type | Allowed Values | Required |
|---|---|---|---|---|
| metadata_id | Unique identifier for the metadata | String | UUID format | No |
| code | Metadata code | String | No | |
| title | Title of the metadata | String | Non-empty string | Yes |
| description | Description of the metadata | String | No | |
| type | Type of metadata | String | KVP, TAG, TAXONOMY | Yes |
| value_type | Type of value (required for KVP type) | String | select, text, datetime, number | Yes (for KVP) |
| values | List of possible values | Array[String] | No | |
| metadata | Additional metadata configuration | Object | e.g., {"length": 100, "date_format":"YY"} | No |
| is_active | Activation status | Boolean | true/false | No |
| created_by_name | Name of the creator | String | No |
Response
{
"status_code": 200,
"message": "Successfully created",
"data": {
"metadata_id": "uuid-string",
"title": "Metadata Title",
"code": "metadata-code",
"type": "KVP",
"value_type": "text",
"created_at": "2025-08-25T10:00:00.000Z",
"created_by": "user-id"
}
}
Usage
import requests
# Define the API endpoint and the payload
url = "https://api.kadal.ai/cl/metadata/api/v1/metadata"
token = "your_token_here"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
data = {
"title": "Sample Metadata",
"description": "This is a sample metadata entry",
"type": "KVP",
"value_type": "text",
"values": ["value1", "value2"],
"metadata": {
"length": 100,
"date_format": "YY"
},
"is_active": True
}
# Make the POST request
response = requests.post(url, headers=headers, json=data)
# Print the response
if response.status_code == 200:
print("Response Data:", response.json())
else:
print("Failed to call the API. Status Code:", response.status_code)
print("Response Text:", response.text)
Metadata Search Endpoint
- Method: POST
- Path:
https://api.kadal.ai/cl/metadata/api/v1/metadata/search - Summary: List or search metadata in the repository
Description
This endpoint allows searching and listing metadata entries with various filtering options. It supports both regular text search and semantic search capabilities.
Request
-
Content-Type: application/json
-
Authorization: Bearer token required
-
Query Parameters
| Parameter | Description | Data Type | Default | Required |
|---|---|---|---|---|
| page_no | Page number for pagination | Integer | 0 | No |
| page_size | Number of items per page | Integer | 100 | No |
| is_search_on_value | Enable search in metadata values | Boolean | true | No |
| semantic_search | Enable semantic search capability | Boolean | false | No |
| ext_user_id_ref | External user ID reference | String | No |